package com.mes.cloud.web;

import com.mes.cloud.api.dto.request.MergeQueryRequest;
import com.mes.cloud.api.dto.response.MergeQueryDto;
import com.mes.cloud.common.JsonResult;
import com.mes.cloud.service.MergeQueryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <合并查询>
 *
 * @author xy
 * @version 1.0
 * @date 2019/11/21 10:51
 */
@Api(tags = "合并查询", value = "合并查询接口")
@RestController
@RequestMapping(value = "/mergeQuery")
public class MergeQueryController  {

    private MergeQueryService mergeQueryService;

    @Autowired
    public MergeQueryController(MergeQueryService mergeQueryService) {
        this.mergeQueryService = mergeQueryService;
    }

    @ApiOperation(value = "组织数据合并查询", notes = "组织数据合并查询")
    @PostMapping(value = "/organizationMergeQuery")
    public JsonResult<MergeQueryDto> organizationMergeQuery(@Valid @RequestBody MergeQueryRequest mergeQueryRequest) {
        return mergeQueryService.organizationMergeQuery(mergeQueryRequest);
    }

    @ApiOperation(value = "岗位数据合并查询", notes = "岗位数据合并查询")
    @PostMapping(value = "/positionMergeQuery")
    public JsonResult<MergeQueryDto> positionMergeQuery(@Valid @RequestBody MergeQueryRequest mergeQueryRequest) {
        return mergeQueryService.positionMergeQuery(mergeQueryRequest);
    }


}
